# -*- python -*-

# Copyright Jim Bosch 2010-2012.
# Distributed under the Boost Software License, Version 1.0.
#    (See accompanying file LICENSE_1_0.txt or copy at
#          http://www.boost.org/LICENSE_1_0.txt)

import sys
import os
Import(['env', 'EXT_SUFFIX', 'LIB_SUFFIX', 'OBJ_SUFFIX'])

LIB_BOOST_NUMPY = ('boost_numpy' + LIB_SUFFIX)
sourcefiles = Glob("*.cpp")
if os.name == 'nt':
    lib = env.StaticLibrary(LIB_BOOST_NUMPY, source=sourcefiles)
else:
    mods = [g.name.replace('.cpp', '') for g in sourcefiles]
    for m in mods:
        env.SharedObject (target=m+OBJ_SUFFIX, source=m+'.cpp')
    lib = env.SharedLibrary(LIB_BOOST_NUMPY, source=[m+OBJ_SUFFIX for m in mods])

Return("lib")
